package cn.fivestars.springcloud.order.service;

import cn.fivestars.springcloud.commons.entities.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Feign功能接口
 *
 * @author liangchenzhou1024 @163.com
 * @date 2021 /2/5
 */
@Service
@FeignClient(value = "cloud-provider-hystrix-payment", fallback = PaymentFeignFallbackServiceImpl.class)
public interface PaymentFeignService {
    /**
     * Gets by id *
     *
     * @param id id
     * @return the by id
     */
    @GetMapping("/payment/{id}")
    <T> CommonResult<T> getById(@PathVariable("id") Long id);

    /**
     * Time out common result
     *
     * @param id id
     * @return the common result
     */
    @GetMapping("/payment/timeout/{id}")
    <T> CommonResult<T> timeout(@PathVariable("id") Long id);
}
